<% task = Task.new
  task.competition = @competition %>
<div class="" style="padding-top:10px;width:75%">
  <div class="bar title_bar"><h4>新任务</h4></div>
  <div class="bar body">
    <%= form_for task, html: { id: 'form_tasknc' } do |f| %>
      <%= f.hidden_field :competition_id %>
      <dl>
        <dt><%= f.label :title, '标题' %></dt>
        <dt><%= f.text_field :title, 'class' => 'single-line' %></dt>
      </dl>
      <dl>
        <dt><%= f.label :due, '截止日期' %></dt>
        <dt><%= f.date_select :due, :order => [:year, :month, :day] %></dt>
      </dl>
      <dl>
        <dt><%= f.label :assigned_to_id, '指派给' %></dt>
        <dt><%= f.select :assigned_to_id, User.all.collect{|u| [u.name_display, u.id] }
          .insert(0, ['未指派', '']), {}, { style: 'width:50%' } %></dt>
      </dl>
      <%= f.submit '提交', 'class' => 'button primary form' %>
    <% end %>
  </div>
</div>